<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        //声明对象时方法的简写
        let person = {
            name: 'zyw',
            eat: function(food){
                console.log(this.name+"吃"+food)
            },
            //this 当前窗口
            //eat2: food => console.log(this+"吃"+food),
            eat2: food => console.log(person.name+"吃"+food),
            eat3(food){
                console.log(this.name+"吃"+food)
            }
        }

        person.eat('橘子')
        person.eat2('苹果')
        person.eat3('香蕉')

    </script>
</head>
<body>

</body>
</html>